<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--使用taglib 引入标签库--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
  <title>登录页面</title>
  <link rel="stylesheet" type="text/css" href="css/login.css">
</head>
<body>
<div class="container">
  <h2>登录</h2>
  <form action="login" method="post">
    <label for="userid">用户名:</label>
    <input type="text" id="userid" name="userid" required>

    <label for="password">密码:</label>
    <input type="password" id="password" name="password" required>

    <label for="identity">身份:</label>
    <select id="identity" name="identity">
      <option value="user">管理员</option>
      <option value="instructor">辅导员</option>
      <option value="student">学生</option>
    </select>

    <input type="submit" value="登录">
  </form>
</div>
<script type="text/javascript">
  window.onload = function () {
    // 使用 JSTL 判断并插入操作结果
    <c:if test="${operation == 'success'}">
    alert("操作成功！");
    </c:if>
    <c:if test="${operation == 'failure'}">
    alert("操作失败，错误信息：${message}");
    </c:if>
  };
</script>
</body>
</html>
